<?php
//****************************************************
// JTBC CMS Power by Jetiben.com
// Email: jetiben@hotmail.com
// Web: http://www.jtbc.net.cn/
//****************************************************


function jtbc_cms_module_index() {
	global $db,$ndatabase, $nidfield;
	$id = ii_get_num ( $_GET ['id'] );
	$tsqlstr = "select * from $ndatabase where " . ii_cfname ( 'hidden' ) . "=0 order by " . ii_cfname('time') . " desc";
	$db->sqlcmd = $tsqlstr;
	$list = $db->execute_reader ();
	if (! empty ( $id )) {
		foreach ( $list as $row ) {
			if ($row [$nidfield] == $id) {
				$result = $row;
				include View ( "index" );
				return;
			}
		}
	}
	if (count ( $list ) > 0) {
		$result = $list [0];
	}
	include View ( "index" );
}

function jtbc_cms_module() {
	return jtbc_cms_module_index ();
}
//****************************************************
// JTBC CMS Power by Jetiben.com
// Email: jetiben@hotmail.com
// Web: http://www.jtbc.net.cn/
//****************************************************
?>
